package cn.ilikes.tools.nosql.test.jpa.pojos.relation;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import cn.ilikes.tools.nosql.jpa.annotations.Index;
import cn.ilikes.tools.nosql.jpa.annotations.IndexColumn;

@Entity
@Table(name = "tests_many2one", schema = "ilikes")
@Index
public class Many2one {

	@Id
	@IndexColumn(index = IndexColumn.Index.analyzed, name = "cycleId", store = IndexColumn.Store.yes)
	private String id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "one_Id")
	private One one;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public One getOne() {
		return one;
	}

	public void setOne(One one) {
		this.one = one;
	}

}
